// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 

package com.yztag;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.SimpleTagSupport;

public class YzButton extends SimpleTagSupport {
    protected String id;
    protected String href;
    protected String name;
    protected String power;
    protected String cssClass;

    public YzButton() {
    }


    public void doTag()
            throws JspException, IOException {
        StringBuffer sb = new StringBuffer();
        HttpServletRequest request = (HttpServletRequest) ((PageContext) getJspContext()).getRequest();
//    		权限暂时不判断，新代码 lqf 2015-6-18 
        sb.append("<a href='" + href + "' class=" + cssClass + " id='" + id + "'>" + name + "</a>	");
//    		 权限暂时不判断，老代码
//     		Sysuser sysuser=(Sysuser)request.getSession().getAttribute("admin");
//     		if(sysuser.getLoginname().equals("admin")){
//     			sb.append("<a href='"+href+"' class="+cssClass+" id='"+id+"'>"+name+"</a>	");
//     		}else{
//     		String menuid=sysuser.getSysrole().getMenuid();
//     		String[] menuids=menuid.split("\\|");
//     		for(String m:menuids){
//     			if(power.equals(m)){
//     				sb.append("<a href='"+href+"' class="+cssClass+" id='"+id+"'>"+name+"</a>	");
//     				continue;
//     			}
//     		}
//     		}
        //���������ҳ����
        getJspContext().getOut().println(sb);
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setHref(String href) {
        this.href = href;
    }


    public void setId(String id) {
        this.id = id;
    }

    public void setPower(String power) {
        this.power = power;
    }


    public void setCssClass(String cssClass) {
        this.cssClass = cssClass;
    }


}
